﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ZLDC.Common.Estate;
using System.Data;

namespace ZLDC.Topo.BLL.Estate
{
     public class ShowFloorPaperBLL
    {
         public static string p_showFloorPaper_save(int Id, string paperNo, int addUserId, int oprUserId, string oprUserName, int ownerUserId, string ownerUserName, int isUse)
         {
             string outmsg = "";
             int newid = 0;
             using (_Database db = new _Database("estate"))
             {
                 ZLDC.DAL.Estate.ShowFloorPaperDAL.p_showFloorPaper_save(Id, paperNo, addUserId, oprUserId, oprUserName, ownerUserId, ownerUserName, isUse, out outmsg, out newid, db);
             }

             return outmsg; 
         }

         public static int IsExistsPaperNo(int paperNo)
         {
             return ZLDC.DAL.Estate.ShowFloorPaperDAL.IsExistsPaperNo(paperNo);
         }

                                                                        public static string p_showFloorPaper_list_table(int page,int pagesize,string condition)
         {
            DataTable dt = null;
            int total = 0;                       int pageall = 0;         
            using (_Database db = new _Database("estate"))
            {
                dt = ZLDC.DAL.Estate.ShowFloorPaperDAL.p_showFloorPaper_list_table(page, pagesize, condition, ref total, db);
            }

            pageall = _Utility.GetPageAll(pagesize, total);               
            _Json json = new _Json(dt);

            return "{page:{currentpage:'" + page + "',pagesize:'" + pagesize + "',total:'" + total + "',pageall:'" + pageall + "'},record:" + json.ToJson() + "}";

         }

                                                      public static string p_showFloorPaper_delete(string IdList) 
         {
             string outmsg="";
             using (_Database db = new _Database("estate")) 
             {
                 ZLDC.DAL.Estate.ShowFloorPaperDAL.p_showFloorPaper_delete(IdList, out outmsg, db);
             }
             return outmsg;
         }
    }
}
